package com.zmy.xcx.dao.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 高血压自检表实体类
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "hypertension_self_check", autoResultMap = true)
public class HypertensionSelfCheck {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    //@TableField("openid")
    private String openid;
    @TableField("age")
    private Integer age;

    /**
     * 年龄段: 0-16岁以下儿童, 1-16岁及以上成人, 2-60岁及以上老年人
     */
    @TableField("age_group")
    private Integer ageGroup;

    /**
     * 用户自检详情内容（JSON格式存储）
     */
    @TableField(value = "check_details", typeHandler = JacksonTypeHandler.class)
    private Map<String,String> checkDetails;

    /**
     * 是否疑似高血压: 0-否, 1-是
     */
    @TableField("is_suspected")
    private Integer isSuspected;

    /**
     * 高血压分级: 1-一级, 2-二级, 3-三级
     */
    @TableField("hypertension_level")
    private Integer hypertensionLevel;

    /**
     * 心血管风险分级: 0-低危, 1-中危, 2-高危/极高危
     */
    @TableField("cardiovascular_risk")
    private Integer cardiovascularRisk;

    /**
     * 是否中医辨证: 0-否, 1-是
     */
    @TableField("has_tcm_diagnosis")
    private Integer hasTcmDiagnosis;

    /**
     * 选择症状列表（JSON格式存储）
     */
    @TableField(value = "selected_symptoms", typeHandler = JacksonTypeHandler.class)
    private List<String> selectedSymptoms;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 逻辑删除: 0-未删除, 1-已删除
     */
    @TableLogic
    @TableField("del_flag")
    private Integer delFlag;
}
